<?php
	/**
	 * 获取金币场信息
	 */
    class Getvenue extends APIBase {
		
		public $tag = "Getvenue";
		public $isLogin = true;
		
		public function before() {
			$this->initCacheRedis();
			$this->initMysql();
			return true;
		}

		public function logic() {
			$uid = $this->uid;
			$len = $this->cache_redis->LLEN("lv:ids");
			$idArr = $this->cache_redis->LRANGE("lv:ids",0,$len);
			if(!empty($idArr)){
				$list = array();
			    foreach($idArr as $val){
			        $row = $this->cache_redis->hMGet("hv:".$val,array('id','GameID','base_money','min_money','max_money','versusroomcfg','level'));
				    if((int)$row['GameID']==99999997){
					    $list[] = array('id'=>$val,'GameID'=>$row['GameID'],'base_money'=>$row['base_money'],'min_money'=>$row['min_money'],'max_money'=>$row['max_money'],'versusroomcfg'=>$row['versusroomcfg'],'level'=>$row['level']);
				    }
			    }
			    $this->returnData($list);
			}else{
				$this->returnError(301,'数据异常');
			}
			
		}
		
    	public function after() {
			$this->deinitCacheRedis();
		}
    }
?>
